<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>附录</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" type="text/css" href="../../css/note.css" />
</head>
<body>

<h2>微积分表</h2>

<h3>微分表</h3>

<table>
<tr>
	<td>`f(x)`</td>
	<td>`f^'(x)`</td>
	<td>`f(x)`</td>
	<td>`f^'(x)`</td>
</tr>
<tr>
	<td>`sin x`</td>
	<td>`cos x`</td>
	<td>`sinh x`</td>
	<td>`cosh x`</td>
</tr>
<tr>
	<td>`cos x`</td>
	<td>`-sin x`</td>
	<td>`cosh x`</td>
	<td>`sinh x`</td>
</tr>
<tr>
	<td>`tan x`</td>
	<td>`1/(cos^2 x)`</td>
	<td>`tanh x`</td>
	<td>`1/(cosh^2 x)`</td>
</tr>
<tr>
	<td>`cot x`</td>
	<td>`- 1/(sin^2 x)`</td>
	<td>`coth x`</td>
	<td>`- 1/(sinh^2 x)`</td>
</tr>
<tr>
	<td>`arcsin x`</td>
	<td>`1/sqrt(1-x^2)`</td>
	<td>`"arsh "x`</td>
	<td>`1/sqrt(x^2+1)`</td>
</tr>
<tr>
	<td>`arccos x`</td>
	<td>`- 1/sqrt(1-x^2)`</td>
	<td>`"arch "x`</td>
	<td>`1/sqrt(x^2-1)`</td>
</tr>
<tr>
	<td>`arctan x`</td>
	<td>`1/(1+x^2)`</td>
	<td>`"arth "x`</td>
	<td>`1/(1-x^2)`</td>
</tr>
</table>

<h3>积分表</h3>

<table>
<tr>
	<td>`f^'(x)`</td>
	<td>`f(x)`</td>
</tr>
<tr>
	<td>`tan x`</td>
	<td>`-ln |cos x|`</td>
</tr>
<tr>
	<td>`cot x`</td>
	<td>`ln |sin x|`</td>
</tr>
<tr>
	<td>`sec x`</td>
	<td>`ln |sec x + tan x|`,
		`-1/2 ln {:(1-sinx)/(1+sinx):}`</td>
</tr>
<tr>
	<td>`csc x`</td>
	<td>`ln |csc x - cot x|`,
		`1/2 ln {:(1-cosx)/(1+cosx):}, ln |tan{:x/2:}|`</td>
</tr>
<tr>
	<td>`1/sqrt(a^2-x^2)`</td>
	<td>`arcsin{:x/a:}`,
		`-arccos{:x/a:}`</td>
</tr>
<tr>
	<td>`1/(a^2+x^2)`</td>
	<td>`1/a arctan{:x/a:}`</td>
</tr>
<tr>
	<td>`tanh x`</td>
	<td>`ln("e"^x+"e"^-x)`,
		`ln cosh x`</td>
</tr>
<tr>
	<td>`coth x`</td>
	<td>`ln |"e"^x-"e"^-x|`,
		`ln |sinh x|`</td>
</tr>
<tr>
	<td>`1/cosh x`</td>
	<td>`2 arctan "e"^x`,
		`arctan sinh x`</td>
</tr>
<tr>
	<td>`1/sinh x`</td>
	<td>`ln {:|"e"^x-1|/("e"^x+1):}`,
		`1/2 ln {:(coshx-1)/(coshx+1):}`,
		`ln {:(coshx-1) / |sinhx|:}`</td>
</tr>
<tr>
	<td>`1/sqrt(x^2+a^2)`</td>
	<td>`ln (x+sqrt(x^2+a^2))`,
		`"arsh "{:x/a:}`</td>
</tr>
<tr>
	<td>`1/sqrt(x^2-a^2)`</td>
	<td>`ln |x+sqrt(x^2-a^2)|`,
		`sgn x * "arch "{:|x|/a:}`</td>
</tr>
<tr>
	<td>`1/(x^2-a^2)`</td>
	<td>`1/(2a) ln |(x-a)/(x+a)|`,
		`-1/a "arth "(x/a)^(sgn(a-|x|))`</td>
</tr>
</table>

<p class="remark">
	`sinh x = ("e"^x - "e"^-x)/2`
	`quad cosh x = ("e"^x + "e"^-x)/2`,
	`quad tanh x = ("e"^x - "e"^-x)/("e"^x + "e"^-x)`;<br/>
	`"arsh "x = ln (x+sqrt(x^2+1))`, `quad x in RR`,<br/>
	`"arch "x = ln (x+sqrt(x^2-1))`, `quad x ge 1`,<br/>
	`"arth "x = 1/2 ln ((1+x)/(1-x))`, `quad -1 lt x lt 1`.
</p>

<h2>级数与无穷乘积</h2>

<h3>幂级数</h3>

<ol>
	设 `|x| lt 1`, 则
	<li>`sum_(n ge 0) x^n = 1/(1-x)` (几何级数);</li>
	<li>`sum_(n ge 1) x^n/n = -ln(1-x)`;</li>
	<li>`sum_(n ge 1, "odd") x^n/n = "arth "x = 1/2 ln|(1+x)/(1-x)|`;</li>
</ol>

<ol class="proof">
	<li>由等式 `(1-x)(1 + x + cdots + x^n) = 1 - x^(n+1)` 得
		<span class="formula">
			`1 + x + cdots + x^n = (1-x^(n+1))/(1-x)`,
		</span>
		两边令 `n to oo` 即得结论.
	</li>
	<li>由几何级数两边从 `0` 到 `x` 积分即可.</li>
	<li>由 `sum_(n ge 0) t^(2n) = 1/(1-t^2)` 两边从 `0` 到 `x` 积分即可.
	</li>
</ol>

<table>
<tr>
	<td style="min-width: 100px">收敛域</td>
	<td>函数</td>
	<td>级数展开</td>
</tr>
<tr>
	<td>`|x| lt oo`</td>
	<td>`"e"^x`</td>
	<td>`sum_(n ge 0) x^n/(n!) = 1 + x + x^2/(2!) + x^3/(3!) + cdots`</td>
</tr>
<tr>
	<td>`|x| lt 1`</td>
	<td>`1/(1-x)`</td>
	<td>`sum_(n ge 0) x^n = 1 + x + x^2 + x^3 + cdots`</td>
</tr>
<tr>
	<td>`|x| lt 1`</td>
	<td>`(1+x)^alpha`</td>
	<td>`sum_(n ge 0) (alpha;n) x^n = 1 + alpha x + (alpha(alpha-1)) / (2!) x^2 + (alpha(alpha-1)(alpha-2))/(3!) + cdots`</td>
</tr>
<tr>
	<td>`|x| lt 1`</td>
	<td>`ln(1+x)`</td>
	<td>`sum_(n ge 0) (-1)^n x^(n+1)/(n+1) = x - x^2/2 + x^3/3 - x^4/4 + cdots`</td>
</tr>
<tr>
	<td>`|x| lt oo`</td>
	<td>`sinh x`</td>
	<td>`sum_(n ge 0) x^(2n+1)/((2n+1)!) = x + x^3/(3!) + x^5/(5!) + x^7/(7!) + cdots`</td>
</tr>
<tr>
	<td>`|x| lt oo`</td>
	<td>`cosh x`</td>
	<td>`sum_(n ge 0) x^(2n)/((2n)!) = 1 + x^2/(2!) + x^4/(4!) + x^6/(6!) + cdots`</td>
</tr>
<tr>
	<td>`|x| lt 1`</td>
	<td>`"arth "x`</td>
	<td>`sum_(n ge 0) x^(2n+1)/(2n+1) = x + x^3/3 + x^5/5 + x^7/7 + cdots`</td>
</tr>
<tr>
	<td>`|x| lt 1`</td>
	<td>`arcsin x`</td>
	<td>`sum_(n ge 0) ((2n-1)!!)/((2n)!!) x^(2n+1)/(2n+1) = x + 1/6 x^3 + 3/40 x^5 + 5/112 x^7 + 35/1152 x^9 + cdots`</td>
</tr>
<tr>
	<td>`|x| gt 1`</td>
	<td>`"arch "x`</td>
	<td>`ln 2x - sum_(n ge 1) (-1)^n ((2n-1)!!)/((2n)!!) x^(-2n)/(2n) = ln 2x - 1/(4x^2) - 3/(32x^4) - 15/(288x^6) - cdots`</td>
</tr>
<tr>
  <td>`|x| lt 2pi`</td>
  <td>`x/("e"^x-1)`</td>
  <td>`sum_(n ge 0) B_n/(n!) x^n = 1 - x/2 + x^2/6 -x^4/30 + 5/66 x^6 - cdots`</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`coth x`</td>
	<td>`1/x sum_(n ge 0) B_(2n)/((2n)!) (2x)^(2n) = 1/x + 1/3 x - 1/45 x^3 + 2/945 x^5 + cdots`</td>
</tr>
<tr>
	<td>`|x| lt pi/2`</td>
	<td>`tanh x`</td>
	<td>`1/x sum_(n ge 1) B_(2n)/((2n)!) (4^n-1)(2x)^(2n) = x - 1/3 x^3 + 2/15 x^5 - 17/315 x^7 + 62/2835 x^9 - 1382/155925 x^11 + cdots`</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`csc x`</td>
	<td>`1/x sum_(n ge 0) (-1)^n B_(2n)/((2n)!) (2-4^n) x^(2n) = 1/x + 1/6 x + 7/360 x^3 + 31/15120 x^5 + 127/604800 x^7 + 73/3421440 x^9 + cdots`</td>
</tr>
<tr>
	<td>`|x| lt pi/2`</td>
	<td>`1/(cosh x)`</td>
	<td>`sum_(n ge 0) E_(2n)/((2n)!) x^(2n) = 1 - 1/2 x^2 + 5/24 x^4 - 61/720 x^6 - cdots`</td>
</tr>
<tr>
	<td></td>
	<td>`"erf"(x)`</td>
	<td>`2/(sqrt pi) sum_(n ge 0) (-1)^n/(n!) x^(2n+1)/(2n+1)`</td>
</tr>
</table>

<ol class="proof">
<li>在
	<span class="formula">
		`1/sqrt(1-x^2) = sum_(n ge 0) (-1/2; n) (-x^2)^n`
		`= sum_(n ge 0) ((-1/2)(-3/2) cdots (-(2n-1)/2))/(n!) (-x^2)^n`
		`= sum_(n ge 0) ((2n-1)!!)/((2n)!!) x^(2n)`
	</span>
	两边逐项积分, 就得到 `arcsin x` 的展式.
</li>
<li>将 `"erf"(x) = 2/sqrt pi int_0^x "e"^(-t^2) dt` 
	的被积函数展开并逐项积分, 就得到 `"erf"(x)` 的展式.
</li>
</ol>

<p class="remark">
  <b>双阶乘</b> `n` 为正整数时,
  <span class="formula">
    `(2n)!! = 2 * 4 * 6 * cdots * 2n`,
    `quad (2n-1)!! = 1 * 3 * 5 * cdots * (2n-1)`.
  </span>
  特别约定 `0!! = (-1)!! = 1`.
</p>

<ol class="remark">
  <li>
	`B_(2n)` 是 <a href="../analysis/10.html">Bernoulli 数</a>.
  满足 `B_0 = 1, B_1 = -1/2, B_3 = B_5 = B_7 = cdots = 0`.
  事实上由生成函数知道
  <span class="formula">
    `x = ("e"^x-1) sum_(k ge 0) B_k x^k/(k!)`
    `= (sum_(j ge 1) x^j/(j!)) (sum_(k ge 0) B_k x^k/(k!))`
    `= sum_(n ge 1) x^n/(n!) sum_(k=0)^(n-1) B_k (n; k)`.
  </span>
  等号两边比较系数得
  <span class="formula">
    `sum_(k=0)^n (n+1; k) B_k = 0`, `quad n ge 1`.
  </span>
  </li>
	<li>
	`E_(2n)` 是 Euler 数, 它是正负号交错的整数:
	<span class="formula">
		`E_0 = 1`, `E_2 = -1`, `E_4 = 5`, `E_6 = -61`, `E_8 = 1385`, `E_10
		= -50521`.
	</span>
	由 `E_(2n)` 的生成函数知道,
	<span class="formula">
		`1 = cosh x sum_(k ge 0) E_(2k)/((2k)!) x^(2k)`
		`= (sum_(j ge 0) x^(2j)/((2j)!)) (sum_(k ge 0) E_(2k)/((2k)!)
		x^(2k))`
		`= sum_(n ge 0) x^(2n)/((2n)!) sum_(k=0)^n (2n;2k) E_(2k)`
	</span>
	比较等式两边的各次项系数, 得到递推公式:
	<span class="formula">
		`sum_(k=0)^n (2n;2k) E_(2k) = 0`, `quad n ge 1`.
	</span>
	</li>
	<li>
	三角函数与其对应的双曲三角函数有简单联系
	<span class="formula">
		`cos x = cosh("i"x)`, `quad cosh x = cos("i"x)`,<br/>
		`sin x = -"i" sinh("i"x)`, `quad sinh x = -"i" sin("i"x)`,<br/>
		`tan x = -"i" tanh("i"x)`, `quad tanh x = -"i" tan("i"x)`,<br/>
		`cot x = "i" coth("i"x)`, `quad coth x = "i" cot("i"x)`,<br/>
		`arccos x = "arch "x("i"x)`, `quad "arch "x = arccos("i"x)`,<br/>
		`arcsin x = -"i arsh "x("i"x)`, `quad "arsh "x = -"i"arcsin("i"x)`,<br/>
		`arctan x = -"i arth "x("i"x)`, `quad "arth "x = -"i"arctan("i"x)`,
	</span>
	因此只需将一个三角函数的级数从第二项起交错改变符号,
	就得到对应的双曲三角函数的级数, 反之亦然. 如
	<span class="formula">
		`cos x = sum_(n ge 0) (-1)^n x^(2n)/((2n)!)`,<br/>
		`"arsh "x = sum_(n ge 0) (-1)^n ((2n-1)!!)/((2n)!!)
		x^(2n+1)/(2n+1)`,<br/>
		`cot x = 1/x sum_(n ge 0) (-1)^n B_(2n)/((2n)!) (2x)^(2n)`.
	</span>
	</li>
</ol>

<p class="example">
	[<a href="https://brilliant.org/practice/algebraic-manipulation-level-3-challenges/?p=1">题源 brilliant.org</a>]
	求 `(sum_(n=1)^oo n/((2n+1)!))/(sum_(n=1)^oo n/((2n-1)!))`.
</p>

<p class="solution">
  将求和写成
  <span class="formula">
    `(2/(3!) + 4/(5!) + 6/(7!) + cdots)/
    (2/(1!) + 4/(3!) + 6/(5!) + cdots)`
  </span>
  分子等于
  <span class="formula">
    `(3-1)/(3!) + (5-1)/(5!) + (7-1)/(7!) + cdots`
    `= 1/(2!) - 1/(3!) + 1/(4!) - 1/(5!) + 1/(6!) - 1/(7!) + cdots`
    `= "e"^-1 - 1 + 1/(1!)`
    `= "e"^-1`.
  </span>
  类似可得分母等于 `"e"`, 于是结果为 `"e"^-2`.
</p>

<p class="example">
  `1/x ln^2 (1+x) = 2 sum_(n ge 1) (-1)^(n+1)/(n+1) H_n x^n`.
</p>

<p class="proof">
  左边等于
  <span class="formula">
    `1/x (sum_(n ge 1) (-1)^(n+1) x^n/n)^2`
    `= sum_(n ge 2) x^(n-1) (-1)^(n+2) sum_(k=1)^(n-1) 1/(k(n-k))`
    `= sum_(n ge 1) x^n (-1)^(n+1) sum_(k=1)^n 1/(k(n+1-k))`.
  </span>
  裂项得
  <span class="formula">
    `sum_(k=1)^n 1/(k(n+1-k))`
    `= 1/(n+1) sum_(k=1)^n (1/k + 1/(n+1-k))`
    `= 2/(n+1) H_n`,
  </span>
  故结论成立.
</p>

<p class="example">
    由 <a href="8.html">digamma 函数</a>的展式得
    <span class="formula">
        `sum_(n ge 1)(1/n - 1/(n+s)) = psi(s+1) + gamma`.
    </span>
</p>

<p class="example">
	<span class="formula">
		`prod_(n ge 1) (1-x^2/n^2) = (sin pi x)/(pi x)`,
	</span>
	两边取对数再求导, 整理得
	<span class="formula">
		`sum_(n ge 1) 1/(n^2-x^2) = 1/(2x^2) (1 - pi x cot pi x)`.
	</span>
	容易得到
	<span class="formula">
		`sum_(n ge 1) 1/(n^2+1) = pi/2 "coth "pi - 1/2`.
	</span>
	此外可以裂项得到
	<span class="formula">
		`sum_(n ge 2) 1/(n^2-1) = 3/4`.
	</span>
</p>

<p class="example">
  [群友 我是某用户的壹零叁]
  把 `x = "i"z` 代入正弦无穷乘积, 变成双曲正弦, 可得
  <span class="formula">
    `prod_(n ge 1) (1+1/n^2) = (sinh pi)/pi`.
  </span>
</p>

<ol class="example">
    求 `f(x) = sum_(n ge 0) x^n/(n!!)` (`0!! = 1`).
</ol>

<p class="solution">
    `f(0) = 1`, 且 `f` 适合微分方程 `y' = x y + 1`. 解得
    <span class="formula">
        `f(x) = sqrt(2/pi) int_(-oo)^x "e"^((x^2-t^2)/2) dt`
        `= "e"^(x^2/2) ("erf"(sqrt 2 x)+1)`.
    </span>
    利用 Wallis 公式知道, 收敛半径为 `oo`.
</p>

<h3>Fourier 级数</h3>

<ol class="example">
	设 `x in (0, 2pi)`, 则
  <!--<li>`sum_(n ge 1) cos n x = -1/2` (然而此级数除特殊点外处处发散);</li>-->
	<li>`sum_(n ge 1) (sin n x)/n = (pi-x)/2`;</li>
	<li>`sum_(n ge 1) (cos n x)/n^2 = x^2/4 - (pi x)/2 + pi^2/6`.</li>
	<li>`sum_(n ge 1) (sin n x)/n^3 = x^3/12 - (pi x^2)/4 + (pi^2 x)/6`.</li>
  在 1. 中替换 `x |-> pi-x`, 就得到 `x` 在 `|x| lt pi` 上的 Fourier
	展开.  类似地, 由 2, 3 分别得 `x^2, x^3` 的 Fourier 展开.
</ol>

<ol class="proof">
  <!--
	<li>利用 Euler 公式, 原式等于
		<span class="formula">
			`sum_(n ge 1) ("e"^(n x"i") + "e"^(-n x"i"))/2`
			`= 1/2 ("e"^(x"i")/(1-"e"^(x"i"))
			+ "e"^(-x"i")/(1-"e"^(-x"i")))`
            `= 1/2 ("e"^(x"i"//2)/("e"^(-x"i"//2)-"e"^(x"i"//2))
            + "e"^(-x"i"//2)/("e"^(x"i"//2)-"e"^(-x"i"//2)))`
			`= -1/2`.
		</span>
	</li>
	<li>由 1. 两边积分,
		<span class="formula">
			`int_pi^x sum_(n ge 1) cos n t dt`
			`= sum_(n ge 1) int_pi^x cos n t dt`
			`= sum_(n ge 1) (sin n x)/n`,<br/>
			`int_pi^x (-1/2) dt = (pi-x)/2`.
		</span>
	</li>
  -->
  <li>直接计算 `(pi-x)//2` 的 Fourier 级数即可.</li>
	<li>上题结果在 `[0, x]` 上逐项积分得
    <span class="formula">
      `sum_(n ge 1) (1-cos n x)/n^2 = pi/2 x - x^2/4`,
    </span>
		再利用 `sum_(n ge 1) n^-2 = pi^2//6` 即得结论.
	</li>
	<li>由上题结果在 `[0, x]` 上积分即得.</li>
</ol>

<ol class="example">
    类似上题有
    <!--<li>`sum_(n ge 1) sin n x = 1/2 cot {:x/2:}`;
        (然而此级数除特殊点外处处发散)
    </li>-->
    <li>`sum_(n ge 1) (cos n x)/n = -ln(2 sin{:x/2:})`;</li>
    <li>`sum_(n ge 1) (sin n x)/n^2 = -int_pi^x ln(2 sin{:t/2:}) dt`;<br/>
    </li>
    令 `x = pi-x`, 又得到
    <!--<li>`sum_(n ge 1) (-1)^(n-1) sin n x = 1/2 tan {:x/2:}`
        (然而此级数除特殊点外处处发散);
    </li>-->
    <li>`sum_(n ge 1) (-1)^n (cos n x)/n = -ln(2 cos{:x/2:})`;</li>
    <li>`sum_(n ge 1) (-1)^(n-1) (sin n x)/n^2 = int_0^x ln(2 cos{:t/2:}) dt`;<br/>
        `x = 0, pi` 时, 等式两边等于 `0`;
        `x = pi/2` 时, 等于 Calatan 常数 `K`.
    </li>
</p>

<p>一般地, `f` 在 `(-pi,pi)` 上的 Fourier 级数可以由以下公式计算:
	<span class="formula">
		`f(x) = a_0/2 + sum_(n ge 1) (a_n cos n x + b_n sin n x)`,<br/>
		`a_n = 1/pi int_(-pi)^pi f(x) cos n x dx`,
		`quad b_n = 1/pi int_(-pi)^pi f(x) sin n x dx`.
	</span>
</p>

<table>
<tr>
	<td>收敛域</td>
	<td>函数</td>
	<td>Fourier 展开</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`x`</td>
	<td>`2 sum_(n ge 1) (-1)^(n-1) (sin n x)/n`</td>
</tr>
<tr>
	<td>`|x| le pi`</td>
	<td>`x^2`</td>
	<td>`pi^2/3 + 4 sum_(n ge 1) (-1)^n (cos n x)/n^2`</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`x^3`</td>
	<td>`sum_(n ge 1) (12-2n^2 pi^2)/n^3 (-1)^n sin n x`</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`"sgn "x`</td>
	<td>`4/pi sum_(n ge 1, "odd") (sin n x)/n`</td>
</tr>
<tr>
	<td>`|x| le pi`</td>
	<td>`|x|`</td>
	<td>`pi/2 - 4/pi sum_(n ge 1, "odd") (cos n x)/n^2`</td>
</tr>
<tr>
	<td>`|x| le pi`</td>
	<td>`x sin x`</td>
	<td>`1 - (cos x)/2 - 2 sum_(n ge 2) (-1)^n (cos n x)/(n^2-1)`</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`x cos x`</td>
	<td>`-(sin x)/2 + 2 sum_(n ge 2) (-1)^n (n sin n x)/(n^2-1)`</td>
</tr>
<tr>
	<td>`|x| lt oo`</td>
	<td>`|sin x|`</td>
	<td>`2/pi - 4/pi sum_(n ge 1, "even") (cos n x)/(n^2 - 1)`</td>
</tr>
<tr>
	<td>`|x| lt oo`</td>
	<td>`|cos x|`</td>
	<td>`2/pi - 4/pi sum_(n ge 1, "even") "i"^n (cos n x)/(n^2 - 1)`</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`sinh a x`</td>
	<td>`-2/pi sinh a pi sum_(n ge 1) (-1)^n (n sin n x)/(n^2+a^2)`</td>
</tr>
<tr>
	<td>`|x| le pi`</td>
	<td>`cosh a x`</td>
	<td>`2/pi sinh a pi(1/(2a) + sum_(n ge 1) (-1)^n (a cos n x)/(n^2+a^2))`</td>
</tr>
<tr>
	<td>`|x| lt pi`</td>
	<td>`"e"^(a x)`</td>
	<td>`2/pi sinh a pi(1/(2a) + sum_(n ge 1) (-1)^n (a cos n x - n sin
		n x)/(n^2 + a^2))`
	</td>
</tr>
</table>

<p class="remark">
	提示: 1. `x sin x` 和 `x cos x` 积分时需借助积化和差;
	2. `"e"^(a x) = sinh a x + cosh a x`.
</p>

<p class="remark">
    在 `x` 的展式中取 `x = pi/2`, 得到 `pi//4 = sum_(n ge 1)
    (-1)^(n-1)/(2n-1)`;
    在 `x^2` 的展式中取 `x = pi`, 得到 `sum_(n ge 1) n^-2 = pi^2//6`.
</p>

<h2>积分变换</h2>

<p>详细的讨论参见 <a href="../complex/6.html">积分变换</a>.</p>

<h3>Laplace 变换</h3>

<p>用 Gamma 函数的定义验证表中的第一条公式; 后面几条都是它的推论.</p>

<table>
  <tr>
    <th>原函数 `f(t)`</th>
    <th>像函数 `F(s) = int_0^oo "e"^(-s t) f(t) dt`</th>
    <th>收敛域</th>
  </tr>
  <tr>
    <td>`t^(p-1) "e"^(z t)`</td>
    <td>`(Gamma(p))/(s-z)^p, p gt 0`</td>
    <td>`"Re"s gt "Re"z`</td>
  </tr>
  <tr>
    <td>`"e"^(z t)`</td>
    <td>`1/(s-z)`</td>
    <td>`"Re"s gt "Re"z`</td>
  </tr>
  <tr>
    <td>`t^n` (`n` 是非负整数)</td>
    <td>`n!/s^(n+1)`</td>
    <td>`"Re"s gt 0`</td>
  </tr>
  <tr>
    <td>`cos a t`</td>
    <td>`s/(s^2+a^2)`</td>
    <td>`"Re"s gt 0`</td>
  </tr>
  <tr>
    <td>`sin a t`</td>
    <td>`a/(s^2+a^2)`</td>
    <td>`"Re"s gt 0`</td>
  </tr>
  <tr>
    <td>`delta(t)` (单位脉冲函数)</td>
    <td>`1`</td>
  </tr>
</table>

<p class="remark">
  严格说, `delta(t)` 是广义函数, 我们暂不追究详情;
  直观上它是下面函数族当 `epsi to 0` 的极限:
  <span class="formula">
    `f_epsi(t) = { 1//epsi, if |t| lt epsi; 0, otherwise :}`
  </span>
  于是
  <span class="formula">
    `cc L[delta(t)]`
    `= lim_(epsi to 0) int_0^epsi 1/epsi "e"^(-s t) dt`
    `= lim_(epsi to 0) 1/(epsi s) (1-"e"^(-epsi s)) = 1`.
  </span>
</p>

<h3>Fourier 变换</h3>

<h2>连分数</h2>

[<a href="https://dlmf.nist.gov/3.10">DLMF</a>, <a href="https://www.bilibili.com/video/BV1N7411L7Ho">數心《无限套娃的连分数》</a>,
<a href="https://zhuanlan.zhihu.com/p/109945861">知乎: 连分数展开的一点公式</a>]

<p class="theorem">
  <b>Euler 连分数公式</b>
  `sum_(i=0)^n prod_(j=0)^i a_j`
  `= a_0/(1-) a_1/(1+a_1-) a_2/(1+a_2-) cdots`
  `a_(n-1)/(1+a_(n-1)-) a_n/(1+a_n)`.
</p>

<p class="proof">
  记 `s_k = sum_(i=k)^n prod_(j=k)^i a_j`, 则
  <span class="formula">
    `s_k = sum_(i=k)^n a_k prod_(j=k+1)^i a_j`
    `= a_k(1 + sum_(i=k+1)^n prod_(j=k+1)^i a_j)`
    `= a_k(1+s_(k+1))`,
    `k = 0, 1, cdots, n-1`.
  </span>
  因此
  <span class="formula">
    `s_0 = a_0 (1+s_1)`
    `= a_0/(1-s_1//(1+s_1))`,<br>
    `s_k/(1+s_k)`
    `= a_k/(a_k + a_k//s_k)`
    `= a_k/(a_k + 1//(1+s_(k+1)))`
    `= a_k/(a_k + 1 - s_(k+1)//(1+s_(k+1)))`.
  </span>
  连续运用上式即得原式成立.
</p>

<p class="corollary">
  <b>级数化为连分数</b>
  用 `u_i` 替换 Euler 连分数中的乘积 `prod_(j=0)^i a_j`, 得到
  <span class="formula">
    `sum_(i=0)^n u_i`
    `= a_0/(1-) a_1/(b_1-) a_2/(b_2-) cdots a_n/b_n`,
  </span>
  其中 `a_0 = u_0`, `b_0 = 1`,
  <span class="formula">
    `a_n = u_n//u_(n-1)`, `quad b_n = 1 + a_n`, `quad n ge 1`.
  </span>
  故一个各项不为零的级数, 形式上可以表示为连分数,
  使得其第 `n` 个部分和等于连分数的第 `n` 项近似.
</p>

<p class="corollary">
  <b>无穷乘积化为连分数</b>
  利用下式将无穷乘积写为级数:
  <span class="formula">
    `prod_(n ge 1) (1 + a_n/b_n)`
    `= 1 + a_1/b_1 + a_2/b_2(1+a_1/b_1) + a_3/b_3(1+a_1/b_1)(1+a_2/b_2)
    + cdots`
  </span>
  再将级数化为连分数, 得
  <span class="formula">
    `1/(1-) (a_1//b_1)/(1+a_1//b_1-)`
    `(a_2//b_2 (1+b_1//a_1))/(1+a_2//b_2(1+b_1//a_1)-)`
    `(a_3//b_3 (1+b_2//a_2))/(1+a_3//b_3(1+b_2//a_2)-) cdots`.
  </span>
</p>

<ol class="example">
  利用 Taylor 展开,
  <li>指数函数
    <span class="formula align">
      `"e"^x = 1 + 1 * x + 1 * x * x^2/2 + cdots`<br>
      `= 1/(1-) x/(1+x-) (x//2)/(1+x//2-) (x//3)/(1+x//3-) cdots`<br>
      `= 1/(1-) x/(1+x-) x/(2+x-) (2x)/(3+x-) (3x)/(4+x-) cdots`,
    </span>
    特别
    <span class="formula">
      `"e" = 1/(1-) 1/(2-) 1/(3-) 2/(4-) 3/(5-) cdots`.
    </span>
    上面的连分数只是幂级数的另一种写法, 其各项截断等于幂级数的各个部分和,
    因此其收敛性由幂级数的收敛性保证.
    和 `"e"` 的无穷级数一样, 该连分数收敛很快, 取 n = 12 就得到
    `"e"` 的近似值 2.718281828703704.
  </li>
  <li>正弦函数
    <span class="formula align">
      `sin x = x + x * (-x^2)/3 + x * (-x^2)/3 * (-x^2)/5 + cdots`<br>
      `= x/(1-) ((-x^2)//(2*3))/(1-x^2//(2*3)-) ((-x^2)//(4*5))/(1-x^2//(4*5)-) cdots`<br>
      `= x/(1+) x^2/(2*3-x^2+) (2*3 x^2)/(4*5-x^2+) cdots`
    </span>
  </li>
  <li>反正切函数
    <span class="formula align">
      `arctan x = x + x * (-x^2)/3 + x * (-x^2)/3 * (-3x^2)/5 + cdots`<br>
      `= x/(1-) (-x^2//3)/(1-x^2//3-) (-3x^2//5)/(1-3x^2//5-) cdots`<br>
      `= x/(1+) x^2/(3-x^2+) (3x)^2/(5-3x^2+) (5x)^2/(7-5x^2+) cdots`,
    </span>
    特别
    <span class="formula">
      `pi/4 = 1/(1+) 1^2/(2+) 3^2/(2+) 5^2/(2+) cdots`.
    </span>
    和 `arctan` 的展式一样, 上面的连分数收敛很慢. 取 n = 999,
    只得到 `pi` 的近似值 3.143584671557847.
  </li>
</ol>

<p class="theorem">
  <b>连分数的第 `n` 项近似</b>
  记 `b_1/(a_1+) b_2/(a_2+) cdots b_n/a_n = y_n/x_n` (不约分),
  则分子和分母均满足二阶线性递推关系:
  <span class="formula">
    `x_0 = 1`, `quad x_1 = a_1`, `quad x_n = a_n x_(n-1) + b_n x_(n-2)`,<br>
    `y_0 = 0`, `quad y_1 = b_1`, `quad y_n = a_n y_(n-1) + b_n y_(n-2)`.
  </span>
  上式给出连分数第 `n` 项近似的算法.
  反之, 任意两个满足上面递推关系的数列, 补充定义 `x_0, y_0` 后,
  它们商可以展开为连分数. 例如 Fibonacci
  数列满足 `F_0 = 0`, `F_1 = 1`, `F_n = F_(n-1) + F_(n-2)`, 因此
  <span class="formula">
    `F_n/F_(n+1)`
    `= F_n/(F_n + F_(n-1))`
    `= 1/(1+F_(n-1)//F_n)`
    `= cdots`
    `= 1/(1+) 1/(1+) cdots 1/1`.
  </span>
</p>

<p class="proof">
  容易验证边界条件成立. 假设成立
  <span class="formula">
    `y_n/x_n = (a_n y_(n-1) + b_n y_(n-2))/(a_n x_(n-1) + b_n x_(n-2))`,
  </span>
  用 `a_n + b_(n+1)//a_(n+1)` 替换公式中的 `a_n` 得
  <span class="formula">
    `y_(n+1)/x_(n+1)`
    `= ((a_n + b_(n+1)//a_(n+1)) y_(n-1) + y_n - a_n y_(n-1)) /
    ((a_n + b_(n+1)//a_(n+1)) x_(n-1) + x_n - a_n x_(n-1))`
    `= (a_(n+1) y_n + b_(n+1) y_(n-1))/(a_(n+1) x_n + b_(n+1) x_(n-1))`.
  </span>
</p>

<p class="example">
  考虑超几何函数
  <span class="formula">
    `{::}_2 F_1(a,b";"c";"z)`
    `= 1 + (a b)/c z + (a(a+1)b(b+1))/(c(c+1)) z^2/(2!) + cdots`,
  </span>
  取
  <span class="formula">
    `f_(2n) = {::}_2 F_1(a+n,b+n";"c+2n-1";"z)`,<br>
    `f_(2n+1) = {::}_2 F_1(a+n+1,b+n";"c+2n";"z)`,<br>
    `n = 0, 1, 2, cdots`,
  </span>
  则 `f_n = f_(n+1) + k_n z f_(n+2)`, 其中
  <span class="formula">
    `k_(2n) = ((a-c-n+1)(b+n))/((c+2n-1)(c+2n))`,
    `quad k_(2n+1) = ((b-c-n-1)(a+n+1))/((c+2n)(c+2n+1))`.
  </span>
  于是 `f_0/f_1` 可以展开为
  <span class="formula">
    `f_0/(f_1)`
    `= (f_1 + k_0 z f_2)/(f_1)`
    `= 1 + (k_0 z)/(f_1 // f_2)`
    `= cdots`
    `= 1 + (k_0 z)/(1+) (k_1 z)/(1+) cdots`.
  </span>
  特别取 `a = 0`, 则 `f_1 = 1`, 我们就得到 `f_0` 的连分数.
  鉴于许多初等函数都能写成超几何函数, 如
  `arctan z = z {::}_2 F_1(1,1/2";"3/2";"-z^2)`.
  我们得到一些初等函数的连分数:
</p>

<span class="formula">
  `"e"^z = 1/(1-) z/(color(blue)1+) z/(color(red)2-) z/(color(blue)3+) z/(color(red)2-) z/(color(blue)5+) z/(color(red)2-) cdots`,<br>
  `ln(1+z) = z/(1+) z/(2+) z/(3+) (4z)/(4+) (4z)/(5+) (9z)/(6+) (9z)/(7+)
  cdots`,<br>
  `tan z = z/(1-) z^2/(3-) z^2/(5-) z^2/(7-) cdots`, `quad z != (n+1/2)pi, n in ZZ`,<br>
  `arctan z = z/(1+) z^2/(3+) (2z)^2/(5+) (3z)^2/(7+) cdots`,
  `quad "i"z !in (-oo, -1) uu (1, oo)`,<br>
  `arcsin z/sqrt(1-z^2) = z/(1-) (1*2 z^2)/(3-) (1*2 z^2)/(5-)
  (3*4z^2)/(7-) (3*4z^2)/(9-) cdots`,
  `quad z !in (-oo, -1) uu (1, oo)`.
  <br>
</span>

<p class="proof">
  `tanh x` 的连分数的另一证明: 记 `a_(n,k)
  = 1//(2n)!(2n+1)(2n+3)cdots(2n+2k-1)`, 则
  <span class="formula">
    `a_(n,k-1) - (2k-1) a_(n,k)`
    `= { a_(n-1,k-1), if n ge 1; 0, if n = 0 :}`
  </span>
  进而有
  <span class="formula">
    `s_k - (2k-1)`
    `:= (sum_(n ge 0) a_(n,k-1) x^(2n))/(sum_(n ge 0) a_(n,k) x^(2n))
    - (2k-1)`
    `= (sum_(n ge 1) a_(n-1,k+1)x^(2n))/(sum_(n ge 0) a_(n,k) x^(2n))`
    `= x^2(sum_(n ge 0) a_(n,k+1)x^(2n))/(sum_(n ge 0) a_(n,k) x^(2n))`
    `= x^2 // s_(k+1)`,
  </span>
  即 `s_k = (2k-1) + x^2//s_(k+1)`.
  将 `sinh x` 和 `cosh x` 的 Taylor 展式相除,
  <span class="formula">
    `tanh x = x (1 + x^2/(3!) + x^4/(5!) + cdots)/(1 + x^2/(2!) + x^4/(4!)
    + cdots)`
    `= x (sum_(n ge 0) a_(n,1) x^(2n))/(sum_(n ge 0) a_(n,0) x^(2n))`
    `= x // s_1`,
  </span>
  递推得
  <span class="formula">
    `tanh x = x/(1+) x^2/(3+) x^2/(5+) x^2/(7+) cdots`.
  </span>
</p>

<script src="../../js/note.js?type=math"></script>
</body>
</html>
